<?php

declare(strict_types=1);

namespace App\Controller\Notify;

use App\Controller\AbstractController;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use App\Service\OrderService\OrderNotifyService\PddNotifyService;
use App\Service\TaskServer\TaskWorker;

/**
 * 拼多多
 * @Controller(prefix="/Notify/index/userType/pdd/messageType")
 * 切入中间介质
 */
class PddController extends AbstractController
{
    /**
     * @RequestMapping(path="OrderPush", methods="post")
     * 接收拼多多订单推送原始报文+面单信息
     */
    public function OrderPush(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'OrderPush',$request->getParsedBody());
    }
    
    /**
     * @RequestMapping(path="OrderReceive", methods="post")
     * 接收拼多多订单号及明文XP申报单号
     */
    public function orderReceive(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'orderReceiveNew',$request->getParsedBody());
    }
    
    /**
     * @RequestMapping(path="OrderQueryCustomerClearance", methods="post")
     * 查询清关申报报文
     * @param RequestInterface $request
     */
    public function orderQueryCustomerClearance(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'orderQueryCustomerClearance',$request->getParsedBody());
    }
    
    /**
     * @RequestMapping(path="OrderQueryClearanceLogistic", methods="post")
     * 查询清关状态
     * @param RequestInterface $request
     */
    public function orderQueryClearanceLogistic(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'orderQueryClearanceLogistic',$request->getParsedBody());
    }
    
    /**
     * @RequestMapping(path="QueryShopGoodsList", methods="post")
     * 获取拼多多店铺订单数据
     * @param RequestInterface $request
     */
    public function queryShopGoodsList(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryShopOrderList',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="queryShopOrderList", methods="post")
     * 获取拼多多店铺订单数据
     * @param RequestInterface $request
     */
    public function queryShopOrderList(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryShopOrderListTest',$request->getParsedBody());
    }
    
    /**
     * @RequestMapping(path="QueryShopSingleUser", methods="post")
     * 查询单个拼多多用户信息
     * @param RequestInterface $request
     */
    public function queryShopSingleUser(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryShopSingleUser',$request->getParsedBody());
    }
    
    /**
     * @RequestMapping(path="QueryShopUserList", methods="post")
     * 查询拼多多用户列表
     * @param RequestInterface $request
     */
    public function queryShopUserList(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryShopUserList',$request->getParsedBody());
    }
    
    /**
     * @RequestMapping(path="QueryOrderDeclareList", methods="post")
     * 查询订单申报报文
     * @param RequestInterface $request
     */
    public function queryOrderDeclareList(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryOrderDeclareList',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="QueryLogisticDeclareList", methods="post")
     * 查询运单申报报文
     * @param RequestInterface $request
     */
    public function QueryLogisticDeclareList(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryLogisticDeclareList',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="QueryInventoryDeclareList", methods="post")
     * 查询清单申报报文
     * @param RequestInterface $request
     */
    public function QueryInventoryDeclareList(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryInventoryDeclareList',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="QueryInventoryCancelList", methods="post")
     * 查询清单撤单申报报文
     * @param RequestInterface $request
     */
    public function QueryInventoryCancelList(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'queryInventoryCancelList',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="ReceiveDeclareResult", methods="post")
     * 申报结果通知
     * @param RequestInterface $request
     */
    public function ReceiveDeclareResult(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'ReceiveDeclareResult',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="GetRepushOrder", methods="post")
     * 查询PDD重新申报订单列表
     * @param RequestInterface $request
     */
    public function GetRepushOrder(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'GetRepushOrder',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="ReceiveRepushOrder", methods="post")
     * 查询PDD重新申报订单列表
     * @param RequestInterface $request
     */
    public function ReceiveRepushOrder(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'ReceiveRepushOrder',$request->getParsedBody());
    }

    /**
     * @RequestMapping(path="EncryptContent", methods="post")
     * PDD内容加密接口
     * @param RequestInterface $request
     */
    public function EncryptContent(RequestInterface $request)
    {
        return TaskWorker::instance()->addWebNotifyTask(PddNotifyService::class,'EncryptContent',$request->getParsedBody());
    }
}